package com.lagou.rocketmq.task.controller;

import com.lagou.rocketmq.task.model.Response;
import com.lagou.rocketmq.task.model.dto.CreateOrderReq;
import com.lagou.rocketmq.task.service.SeckillingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties.Redis;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 秒杀controller
 *
 */
@RestController
@RequestMapping(value = "/seckilling")
public class SeckillingController {

  @Autowired
  private SeckillingService seckillingService;

  @RequestMapping(value = "/createOrder", method = RequestMethod.POST)
  public Response createOrder(@RequestBody CreateOrderReq req) {
    return seckillingService.addOrder(req);
  }

}
